package com.highspeed.bdk.gateway.socket.analyze.message.preset_deploy.resolver;

import com.highspeed.bdk.gateway.Util;
import com.highspeed.bdk.gateway.socket.analyze.message.preset_deploy.base.MessageResolver;

import java.util.Map;

/**
 * RIO链路APP信息调显结果,部署表
 */
public class RioLinkAppDisplayDeployResolver extends MessageResolver {

    @Override
    protected Map doResolveBody(byte[] response) {
        NodeFuncResolver nodeFuncResolver = new NodeFuncResolver();
        nodeFuncResolver.setContainer(getContainer());
        int i = 1;
        int end;
        while (true) {
            if ((end = Util.getInt(response, getOffset())) == 0xAAAAAAAA) {
                break;
            }
            i++;
            System.out.println("結束......" + end + "..........offset...." + getOffset());
            logger.info("解析第" + i + "个部署信息。。。");
            nodeFuncResolver.doResolveBody(response);
        }
        return nodeFuncResolver.getContainer();
    }
}
